package com.dckeji.shiplock.webapp.conf;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;

/**
 * Created with IntelliJ IDEA.
 * User: TianWei
 * Date: 2017/7/29
 * Time: 11:18
 */
@Configuration
public class TemplateConfig {

    private final Logger logger = LogManager.getLogger(TemplateConfig.class);

    @Autowired
    private DataSource druidDataSource;

    @Bean
    public JdbcTemplate jdbcTemplate() {
        JdbcTemplate jdbcTemplate = new JdbcTemplate();
        jdbcTemplate.setDataSource(druidDataSource);
        return jdbcTemplate;
    }


}
